<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="header.jsp" %>

<div class="card shadow">
    <div class="card-header bg-primary text-white">
        <h4 class="mb-0"><i class="fas fa-heartbeat me-2"></i>健康信息上报</h4>
    </div>
    <div class="card-body">
        <form action="${pageContext.request.contextPath}/UserHealthInsert" method="post" class="needs-validation" novalidate>

            <input type="hidden" name="elderId" value="${sessionScope.user.id}">

            <div class="row g-3">
                <!-- 体温 -->
                <div class="col-md-6">
                    <label class="form-label">体温 (°C)</label>
                    <div class="input-group">
                        <input type="number" class="form-control" name="temperature" step="0.1" min="35" max="42" required>
                        <span class="input-group-text">
                            <i class="fas fa-thermometer-half"></i>
                        </span>
                        <div class="invalid-feedback">
                            请输入35-42℃之间的有效体温值
                        </div>
                    </div>
                </div>

                <!-- 血压 -->
                <div class="col-md-6">
                    <label class="form-label">血压 (mmHg)</label>
                    <div class="input-group">
                        <input type="text" class="form-control" name="bloodPressure" placeholder="例如：120/80" required>
                        <div class="invalid-feedback">
                            请输入有效的血压值，例如：120/80
                        </div>
                    </div>
                </div>

                <!-- 健康状态 -->
                <div class="col-md-6">
                    <label class="form-label">自觉症状</label>
                    <select class="form-select" name="symptoms" required>
                        <option value="">请选择...</option>
                        <option value="无异常">无异常</option>
                        <option value="咳嗽">咳嗽</option>
                        <option value="头晕">头晕</option>
                        <option value="其他不适">其他不适</option>
                    </select>
                </div>

                <!-- 症状描述 -->
                <div class="col-12">
                    <label class="form-label">详细描述</label>
                    <textarea class="form-control" name="description" rows="3" placeholder="请详细描述您的症状..."></textarea>
                </div>
            </div>

            <hr class="my-4">
            <button class="btn btn-primary btn-lg w-100" type="submit">
                <i class="fas fa-paper-plane me-2"></i>提交
            </button>
        </form>
    </div>
</div>

<%@ include file="/footer.jsp" %>